// 报表日历接口列表
export default function (router, DBserve) {
  // 新增报表日历
  router.post("/add/calendar", (req, res) => {
    DBserve({
      DBname: "calendar",
      order: "insert",
      option: req.body,
    }).then(data => {
      // console.log(data);
      res.json(data);
    });
  });
  // 查询报表日历
  router.post("/calendar", (req, res) => {
    // console.log(req.body);
    DBserve({
      DBname: "calendar",
      order: "find",
      option: req.body,
    }).then(data => {
      res.json(data);
    });
  });
  // 删除报表日历
  router.delete("/calendar", (req, res) => {
    // console.log(req.body);
    DBserve({
      DBname: "calendar",
      order: "remove",
      option: { _id: req.body._id },
    }).then(data => {
      res.json(data);
    });
  });
  // 修改报表日历
  router.post("/update/calendar", (req, res) => {
    DBserve({
      DBname: "calendar",
      order: "update",
      option: req.body,
    }).then(data => {
      res.json(data);
    });
  });
}
